package org.example;
//状态模式(实现)
//定义具体的空调状态，如开启状态和关闭状态
public class AirConditionerCleanState implements AirConditionerState {
    @Override
    public void powerOn(AirConditionerController controller, AirConditioner airConditioner) {
        System.out.println("空调已经开启，不能再次开启");
    }

    @Override
    public void powerOff(AirConditionerController controller, AirConditioner airConditioner) {
        System.out.println("空调已关闭");
        controller.removeAirConditioner(airConditioner);
    }

    @Override
    public void clean(AirConditionerController controller, AirConditioner airConditioner) {
        System.out.println("空调已打开空气净化功能");
    }

    @Override
    public void dehumidification(AirConditionerController controller, AirConditioner airConditioner) {
        System.out.println("空调已打开除湿功能");
    }

    @Override
    public void setTemperature(AirConditionerController controller, int temperature) {
        System.out.println("空调温度已设置为" + temperature + "度");
        controller.notifyTemperatureChanged(temperature);
    }
}
